/* **********************************************************************************************************
*                                                                                                           *
*                                   --- Goal ---                                                            *
*                                                                                                           *
* In worksheet 10 you  built a Clock  class  and  a  Time  class.                                            *
* The  Clock  class  has  two instance  variable  links  to  the  Time  class,                              *
* one for  the  current  time  and  one  for  the  alarm  time.                                             *
* This  worksheet  gets  you  to make  an  Application  class  with  a  menu  to  run the clock application *
*                                                                                                           *
*********************************************************************************************************** */

import java.util.Scanner;

public class Application {

	public static void main(String[] args) {
    //System.out.println("Ha! Ha! Edited by Jamie..."); (Commented out due to it being printed rather than hidden in the code)
		Application menu = new Application();
		menu.runMenu();
	}

	public void runMenu() {
   
		// Default Times the clock has when it is started
		Time currentTime = new Time(00, 00);
		Time alarmTime = new Time(00, 00);

		// Creating the scanner to read from the keyboard
		Scanner in = new Scanner(System.in);

		// Creating the clock
		Clock clock1 = new Clock(currentTime, alarmTime, false);

		for (int i = 0; i < 5; i++) {

			// Set the current time

			System.out.print("Please enter the current hour for the clock");
			currentTime.setHours(in.nextInt());
			System.out.print("Please enter the current minutes for the clock");
			currentTime.setMinutes(in.nextInt());

			// Set the alarm time

			System.out.print("Please enter the hour for the alarm");
			alarmTime.setHours(in.nextInt());
			System.out.print("Please enter the minutes for the alarm");
			alarmTime.setMinutes(in.nextInt());

			// Set the alarm on or off

			System.out
					.print("Please state whether or not the alarm is on (Yes/No)");
			
			if (in.next() == "no") {
				clock1.setAlarm(false);
			} else if (in.next() == "false") {
				clock1.setAlarm(true);
			}
			else {
				clock1.setAlarm(true);
			}
         //switched around the trues and falses because the order annoyed me - Ben
         
			
//clock1.setAlarm(in.nextBoolean());
		}
		System.out.print(clock1.toString());
		in.close();
	}
}